import request from '@/utils/request'
import store from '@/store'
//const ascriptionId = store.state.userInfo.ascriptionId;

// 总体学习情况
export function getLearn() {
  const data = {
    ascriptionId: store.state.userInfo.ascriptionId,
  }
  return request({
    url: '/getHomeDataOverallLearning',
    method: 'post',
    data: data
  })
}

// 培训情况
export function getTrain(queryParams) {
  const data = {
    ascriptionId: store.state.userInfo.ascriptionId,
    dateRange: queryParams.dateRange
  }
  return request({
    url: '/getHomeDataTrainSituation',
    method: 'post',
    data: data
  })
}

// 证书情况
export function getCertificate(queryParams) {
  const data = {
    ascriptionId: store.state.userInfo.ascriptionId,
    theType: queryParams.theType,
    alertDays: queryParams.alertDays,
    pagesize: queryParams.pagesize
  }
  return request({
    url: '/getHomeDataCertSituation',
    method: 'post',
    data: data
  })
}

// 资源统计
export function getHomeDataResource() {
  const data = {
    ascriptionId: store.state.userInfo.ascriptionId,
  }
  return request({
    url: '/getHomeDataResource',
    method: 'post',
    data: data
  })
}